{:W('Nav',array('name'=>'商品分类','act'=>'添加分类','URL'=>'addCate'))}
<script type="text/javascript" src="__PUBLIC__/Js/js/utils.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/listtable.js"></script>
<form method="post" action="" name="listForm">
    <!-- start ad position list -->
    <div class="list-div" id="listDiv">
        <table width="100%" cellspacing="1" cellpadding="2" id="list-table">
            <tr>
                <th>分类名称</th>
                <th>后台显示</th>
                <th>导航栏</th>
                <th>排序</th>
                <th>操作</th>
            </tr>
            <foreach name="cate" item="v">
                <tr align="center" class="1" id="{$v.id}">
                    <td align="right" class="first-cell">
                        <span><a href="{:U(GROUP_NAME.'/Category/editCate',array('id'=>$v['id']))}">
                            {$v.html}{$v.cate_name}</a></span>
                    </td>
                    <td width="15%"><img src="__PUBLIC__/Images/images/<if condition='$v.is_show eq 1'>yes<else/>no</if>.gif" /></td>
                    <td width="15%"><img src="__PUBLIC__/Images/images/<if condition='$v.is_nav eq 1'>yes<else/>no</if>.gif" /></td>
                    <td width="15%" align="right">{$v.sort}</td>
                    <td width="29%" align="center">
                        <a href="{:U(GROUP_NAME.'/Category/editCate',array('id'=>$v['id']))}">编辑</a> |
                        <a href="{:U(GROUP_NAME.'/Category/removeCate',array('id'=>$v['id']))}" title="移除">移除</a>
                    </td>
                </tr>
            </foreach>
        </table>
    </div>
</form>


<script language="JavaScript">
    <!--

    onload = function () {
        // 开始检查订单
        startCheckOrder();
    }

    var imgPlus = new Image();
    imgPlus.src = "images/menu_plus.gif";

    /**
     * 折叠分类列表
     */
    function rowClicked(obj) {
        // 当前图像
        img = obj;
        // 取得上二级tr>td>img对象
        obj = obj.parentNode.parentNode;
        // 整个分类列表表格
        var tbl = document.getElementById("list-table");
        // 当前分类级别
        var lvl = parseInt(obj.className);
        // 是否找到元素
        var fnd = false;
        var sub_display = img.src.indexOf('menu_minus.gif') > 0 ? 'none' : (Browser.isIE) ? 'block' : 'table-row';
        // 遍历所有的分类
        for (i = 0; i < tbl.rows.length; i++) {
            var row = tbl.rows[i];
            if (row == obj) {
                // 找到当前行
                fnd = true;
                //document.getElementById('result').innerHTML += 'Find row at ' + i +"<br/>";
            }
            else {
                if (fnd == true) {
                    var cur = parseInt(row.className);
                    var icon = 'icon_' + row.id;
                    if (cur > lvl) {
                        row.style.display = sub_display;
                        if (sub_display != 'none') {
                            var iconimg = document.getElementById(icon);
                            iconimg.src = iconimg.src.replace('plus.gif', 'minus.gif');
                        }
                    }
                    else {
                        fnd = false;
                        break;
                    }
                }
            }
        }

        for (i = 0; i < obj.cells[0].childNodes.length; i++) {
            var imgObj = obj.cells[0].childNodes[i];
            if (imgObj.tagName == "IMG" && imgObj.src != '__PUBLIC__/Images/images/menu_arrow.gif') {
                imgObj.src = (imgObj.src == imgPlus.src) ? '__PUBLIC__/Images/images/menu_minus.gif' : imgPlus.src;
            }
        }
    }
    //-->
</script>


<div id="footer">
    共执行 2 个查询，用时 0.102608 秒，Gzip 已禁用，内存占用 5.108 MB<br/>
    版权所有 &copy; 2005-2017 上海商派软件有限公司，并保留所有权利。
</div>
<!-- 新订单提示信息 -->
<div id="popMsg">
    <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#cfdef4" border="0">
        <tr>
            <td style="color: #0f2c8c" width="30" height="24"></td>
            <td style="font-weight: normal; color: #1f336b; padding-top: 4px;padding-left: 4px" valign="center"
                width="100%"> 新订单通知
            </td>
            <td style="padding-top: 2px;padding-right:2px" valign="center" align="right" width="19"><span title="关闭"
                                                                                                          style="cursor: hand;cursor:pointer;color:red;font-size:12px;font-weight:bold;margin-right:4px;"
                                                                                                          onclick="Message.close()">×</span>
                <!-- <img title=关闭 style="cursor: hand" onclick=closediv() hspace=3 src="msgclose.jpg"> --></td>
        </tr>
        <tr>
            <td style="padding-right: 1px; padding-bottom: 1px" colspan="3" height="70">
                <div id="popMsgContent">
                    <p>您有 <strong style="color:#ff0000" id="spanNewOrder">1</strong> 个新订单以及 <strong
                            style="color:#ff0000" id="spanNewPaid">0</strong> 个新付款的订单</p>
                    <p align="center" style="word-break:break-all"><a href="order.php?act=list"><span
                            style="color:#ff0000">点击查看新订单</span></a></p>
                </div>
            </td>
        </tr>
    </table>
</div>

<!--
<embed src="images/online.wav" width="0" height="0" autostart="false" name="msgBeep" id="msgBeep" enablejavascript="true"/>
-->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" id="msgBeep" width="1"
        height="1">
    <param name="movie" value="images/online.swf">
    <param name="quality" value="high">
    <embed src="images/online.swf" name="msgBeep" id="msgBeep" quality="high" width="0" height="0"
           type="application/x-shockwave-flash"
           pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash">
    </embed>
</object>

<script language="JavaScript">
    document.onmousemove = function (e) {
                var obj = Utils.srcElement(e);
                if (typeof(obj.onclick) == 'function' && obj.onclick.toString().indexOf('listTable.edit') != -1) {
                    obj.title = '点击修改内容';
                    obj.style.cssText = 'background: #278296;';
                    obj.onmouseout = function (e) {
                        this.style.cssText = '';
                    }
                }
                else if (typeof(obj.href) != 'undefined' && obj.href.indexOf('listTable.sort') != -1) {
                    obj.title = '点击对列表排序';
                }
            }
            < !--


    var MyTodolist;
    function showTodoList(adminid) {
        if (!MyTodolist) {
            var global = $import("__PUBLIC__/Js/js/global.js", "js");
            global.onload = global.onreadystatechange = function () {
                if (this.readyState && this.readyState == "loading")return;
                var md5 = $import("js/md5.js", "js");
                md5.onload = md5.onreadystatechange = function () {
                    if (this.readyState && this.readyState == "loading")return;
                    var todolist = $import("__PUBLIC__/Js/js/todolist.js", "js");
                    todolist.onload = todolist.onreadystatechange = function () {
                        if (this.readyState && this.readyState == "loading")return;
                        MyTodolist = new Todolist();
                        MyTodolist.show();
                    }
                }
            }
        }
        else {
            if (MyTodolist.visibility) {
                MyTodolist.hide();
            }
            else {
                MyTodolist.show();
            }
        }
    }

    if (Browser.isIE) {
        onscroll = function () {
            //document.getElementById('calculator').style.top = document.body.scrollTop;
            document.getElementById('popMsg').style.top = (document.body.scrollTop + document.body.clientHeight - document.getElementById('popMsg').offsetHeight) + "px";
        }
    }

    if (document.getElementById("listDiv")) {
        document.getElementById("listDiv").onmouseover = function (e) {
            obj = Utils.srcElement(e);

            if (obj) {
                if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
                else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
                else return;

                for (i = 0; i < row.cells.length; i++) {
                    if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB';
                }
            }

        }

        document.getElementById("listDiv").onmouseout = function (e) {
            obj = Utils.srcElement(e);

            if (obj) {
                if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
                else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
                else return;

                for (i = 0; i < row.cells.length; i++) {
                    if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
                }
            }
        }

        document.getElementById("listDiv").onclick = function (e) {
            var obj = Utils.srcElement(e);

            if (obj.tagName == "INPUT" && obj.type == "checkbox") {
                if (!document.forms['listForm']) {
                    return;
                }
                var nodes = document.forms['listForm'].elements;
                var checked = false;

                for (i = 0; i < nodes.length; i++) {
                    if (nodes[i].checked) {
                        checked = true;
                        break;
                    }
                }

                if (document.getElementById("btnSubmit")) {
                    document.getElementById("btnSubmit").disabled = !checked;
                }
                for (i = 1; i <= 10; i++) {
                    if (document.getElementById("btnSubmit" + i)) {
                        document.getElementById("btnSubmit" + i).disabled = !checked;
                    }
                }
            }
        }

    }

    //-->
</script>
</body>
</html>